/**
 * <p>Title: GMTDateConverterToLocal.java</p>
 * <p>Description: DoNotes</p>
 * @author WangJun
 * @date 2009/11/27 2:16:19
 * @version 1.0
 */
package net.donotes.util.converter;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.Map;

import ognl.DefaultTypeConverter;

/**
 * @author WangJun
 * 
 */
public class GMTDateConverterToLocal extends DefaultTypeConverter {
	@Override
	public Object convertValue(Map map, Object obj, Class toType) {
		SimpleDateFormat sdf = new SimpleDateFormat("",
				Locale.SIMPLIFIED_CHINESE);
		Date date = (Date)obj;
		try {
			date = sdf.parse(sdf.format(date));
		} catch (ParseException e) {
			e.printStackTrace();
		}
		return date;
	}
}